﻿using MiniFox.Infrastructure;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace MiniFox.Data
{
    /// <summary>
    /// 
    /// </summary>
    public interface IResultSet<TEntity>
    {
        /// <summary>
        /// 
        /// </summary>
        int RowCount
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        bool LazyLoad
        {
            get;
        }
        /// <summary>
        /// 
        /// </summary>
        IEnumerable<TEntity> Data
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TModel"></typeparam>
        /// <returns></returns>
        ResultObject<IEnumerable<TModel>> GetResultObject<TModel>() where TModel : new();
        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TModel"></typeparam>
        /// <param name="selectFunc"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<TModel>> GetResultObject<TModel>(Expression<Func<TEntity, TModel>> selectFunc) where TModel : new();
        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TModel"></typeparam>
        /// <param name="selectFunc"></param>
        /// <returns></returns>
        IEnumerable<TModel> Select<TModel>(Expression<Func<TEntity, TModel>> selectFunc);
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        ResultObject<ViewTable> GetTableResultObject();
        /// <summary>
        /// 
        /// </summary>
        /// <param name="tableMapping"></param>
        /// <returns></returns>
        ResultObject<ViewTable> GetTableResultObject(ITableMapping tableMapping);
    }
}
